3.252 \(\int \frac{(e+f x)^2 \cos (c+d x)}{a+a \sin (c+d x)} \, dx\)

Optimal. Leaf size=114 \[ -\frac{4 i f (e+f x) \text{PolyLog}\left (2,i e^{i (c+d x)}\right )}{a d^2}+\frac{4 f^2 \text{PolyLog}\left (3,i e^{i (c+d x)}\right )}{a d^3}+\frac{2 (e+f x)^2 \log \left (1-i e^{i (c+d x)}\right )}{a d}-\frac{i (e+f x)^3}{3 a f} \]

[Out]

((-I/3)*(e + f*x)^3)/(a*f) + (2*(e + f*x)^2*Log[1 - I*E^(I*(c + d*x))])/(a*d) - ((4*I)*f*(e + f*x)*PolyLog[2,
I*E^(I*(c + d*x))])/(a*d^2) + (4*f^2*PolyLog[3, I*E^(I*(c + d*x))])/(a*d^3)

________________________________________________________________________________________

Rubi [A]  time = 0.211358, antiderivative size = 114, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.192, Rules used = {4517, 2190, 2531, 2282, 6589} \[ -\frac{4 i f (e+f x) \text{PolyLog}\left (2,i e^{i (c+d x)}\right )}{a d^2}+\frac{4 f^2 \text{PolyLog}\left (3,i e^{i (c+d x)}\right )}{a d^3}+\frac{2 (e+f x)^2 \log \left (1-i e^{i (c+d x)}\right )}{a d}-\frac{i (e+f x)^3}{3 a f} \]

Antiderivative was successfully verified.

[In]

Int[((e + f*x)^2*Cos[c + d*x])/(a + a*Sin[c + d*x]),x]

[Out]

((-I/3)*(e + f*x)^3)/(a*f) + (2*(e + f*x)^2*Log[1 - I*E^(I*(c + d*x))])/(a*d) - ((4*I)*f*(e + f*x)*PolyLog[2,
I*E^(I*(c + d*x))])/(a*d^2) + (4*f^2*PolyLog[3, I*E^(I*(c + d*x))])/(a*d^3)

Rule 4517

Int[(Cos[(c_.) + (d_.)*(x_)]*((e_.) + (f_.)*(x_))^(m_.))/((a_) + (b_.)*Sin[(c_.) + (d_.)*(x_)]), x_Symbol] :>
-Simp[(I*(e + f*x)^(m + 1))/(b*f*(m + 1)), x] + Dist[2, Int[((e + f*x)^m*E^(I*(c + d*x)))/(a - I*b*E^(I*(c + d
*x))), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IGtQ[m, 0] && EqQ[a^2 - b^2, 0]

Rule 2190

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m*Log[1 + (b*(F^(g*(e + f*x)))^n)/a])/(b*f*g*n*Log[F]), x]
 - Dist[(d*m)/(b*f*g*n*Log[F]), Int[(c + d*x)^(m - 1)*Log[1 + (b*(F^(g*(e + f*x)))^n)/a], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2531

Int[Log[1 + (e_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.)]*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> -Simp[((
f + g*x)^m*PolyLog[2, -(e*(F^(c*(a + b*x)))^n)])/(b*c*n*Log[F]), x] + Dist[(g*m)/(b*c*n*Log[F]), Int[(f + g*x)
^(m - 1)*PolyLog[2, -(e*(F^(c*(a + b*x)))^n)], x], x] /; FreeQ[{F, a, b, c, e, f, g, n}, x] && GtQ[m, 0]

Rule 2282

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 6589

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[PolyLog[n + 1, c*(a
+ b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d, e, n, p}, x] && EqQ[b*d, a*e]

Rubi steps

\begin{align*} \int \frac{(e+f x)^2 \cos (c+d x)}{a+a \sin (c+d x)} \, dx &=-\frac{i (e+f x)^3}{3 a f}+2 \int \frac{e^{i (c+d x)} (e+f x)^2}{a-i a e^{i (c+d x)}} \, dx\\ &=-\frac{i (e+f x)^3}{3 a f}+\frac{2 (e+f x)^2 \log \left (1-i e^{i (c+d x)}\right )}{a d}-\frac{(4 f) \int (e+f x) \log \left (1-i e^{i (c+d x)}\right ) \, dx}{a d}\\ &=-\frac{i (e+f x)^3}{3 a f}+\frac{2 (e+f x)^2 \log \left (1-i e^{i (c+d x)}\right )}{a d}-\frac{4 i f (e+f x) \text{Li}_2\left (i e^{i (c+d x)}\right )}{a d^2}+\frac{\left (4 i f^2\right ) \int \text{Li}_2\left (i e^{i (c+d x)}\right ) \, dx}{a d^2}\\ &=-\frac{i (e+f x)^3}{3 a f}+\frac{2 (e+f x)^2 \log \left (1-i e^{i (c+d x)}\right )}{a d}-\frac{4 i f (e+f x) \text{Li}_2\left (i e^{i (c+d x)}\right )}{a d^2}+\frac{\left (4 f^2\right ) \operatorname{Subst}\left (\int \frac{\text{Li}_2(i x)}{x} \, dx,x,e^{i (c+d x)}\right )}{a d^3}\\ &=-\frac{i (e+f x)^3}{3 a f}+\frac{2 (e+f x)^2 \log \left (1-i e^{i (c+d x)}\right )}{a d}-\frac{4 i f (e+f x) \text{Li}_2\left (i e^{i (c+d x)}\right )}{a d^2}+\frac{4 f^2 \text{Li}_3\left (i e^{i (c+d x)}\right )}{a d^3}\\ \end{align*}

Mathematica [A]  time = 0.990181, size = 221, normalized size = 1.94 \[ \frac{x \left (\cos \left (\frac{c}{2}\right )-\sin \left (\frac{c}{2}\right )\right ) \left (3 e^2+3 e f x+f^2 x^2\right )}{3 a \left (\sin \left (\frac{c}{2}\right )+\cos \left (\frac{c}{2}\right )\right )}-\frac{2 (\cos (c)+i \sin (c)) \left (\frac{2 f (\cos (c)-i (\sin (c)+1)) (d (e+f x) \text{PolyLog}(2,-\sin (c+d x)-i \cos (c+d x))-i f \text{PolyLog}(3,-\sin (c+d x)-i \cos (c+d x)))}{d^3}-\frac{(\sin (c)+i \cos (c)+1) (e+f x)^2 \log (\sin (c+d x)+i \cos (c+d x)+1)}{d}+\frac{(\cos (c)-i \sin (c)) (e+f x)^3}{3 f}\right )}{a (\cos (c)+i (\sin (c)+1))} \]

Antiderivative was successfully verified.

[In]

Integrate[((e + f*x)^2*Cos[c + d*x])/(a + a*Sin[c + d*x]),x]

[Out]

(x*(3*e^2 + 3*e*f*x + f^2*x^2)*(Cos[c/2] - Sin[c/2]))/(3*a*(Cos[c/2] + Sin[c/2])) - (2*(Cos[c] + I*Sin[c])*(((
e + f*x)^3*(Cos[c] - I*Sin[c]))/(3*f) - ((e + f*x)^2*Log[1 + I*Cos[c + d*x] + Sin[c + d*x]]*(1 + I*Cos[c] + Si
n[c]))/d + (2*f*(d*(e + f*x)*PolyLog[2, (-I)*Cos[c + d*x] - Sin[c + d*x]] - I*f*PolyLog[3, (-I)*Cos[c + d*x] -
 Sin[c + d*x]])*(Cos[c] - I*(1 + Sin[c])))/d^3))/(a*(Cos[c] + I*(1 + Sin[c])))

________________________________________________________________________________________

Maple [B]  time = 0.131, size = 421, normalized size = 3.7 \begin{align*}{\frac{2\,i{f}^{2}{c}^{2}x}{a{d}^{2}}}-{\frac{ife{x}^{2}}{a}}-{\frac{2\,ife{c}^{2}}{a{d}^{2}}}+4\,{\frac{ef\ln \left ( 1-i{{\rm e}^{i \left ( dx+c \right ) }} \right ) x}{da}}+4\,{\frac{ef\ln \left ( 1-i{{\rm e}^{i \left ( dx+c \right ) }} \right ) c}{a{d}^{2}}}+4\,{\frac{efc\ln \left ({{\rm e}^{i \left ( dx+c \right ) }} \right ) }{a{d}^{2}}}-{\frac{4\,ife{\it polylog} \left ( 2,i{{\rm e}^{i \left ( dx+c \right ) }} \right ) }{a{d}^{2}}}-4\,{\frac{efc\ln \left ({{\rm e}^{i \left ( dx+c \right ) }}+i \right ) }{a{d}^{2}}}-{\frac{{\frac{i}{3}}{f}^{2}{x}^{3}}{a}}-{\frac{4\,ifecx}{da}}+4\,{\frac{{f}^{2}{\it polylog} \left ( 3,i{{\rm e}^{i \left ( dx+c \right ) }} \right ) }{a{d}^{3}}}-2\,{\frac{{c}^{2}{f}^{2}\ln \left ({{\rm e}^{i \left ( dx+c \right ) }} \right ) }{a{d}^{3}}}+2\,{\frac{{f}^{2}\ln \left ( 1-i{{\rm e}^{i \left ( dx+c \right ) }} \right ){x}^{2}}{da}}-2\,{\frac{{f}^{2}\ln \left ( 1-i{{\rm e}^{i \left ( dx+c \right ) }} \right ){c}^{2}}{a{d}^{3}}}+2\,{\frac{{c}^{2}{f}^{2}\ln \left ({{\rm e}^{i \left ( dx+c \right ) }}+i \right ) }{a{d}^{3}}}-{\frac{4\,i{f}^{2}{\it polylog} \left ( 2,i{{\rm e}^{i \left ( dx+c \right ) }} \right ) x}{a{d}^{2}}}+{\frac{{\frac{4\,i}{3}}{f}^{2}{c}^{3}}{a{d}^{3}}}+{\frac{i{e}^{2}x}{a}}+2\,{\frac{\ln \left ({{\rm e}^{i \left ( dx+c \right ) }}+i \right ){e}^{2}}{da}}-2\,{\frac{\ln \left ({{\rm e}^{i \left ( dx+c \right ) }} \right ){e}^{2}}{da}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f*x+e)^2*cos(d*x+c)/(a+a*sin(d*x+c)),x)

[Out]

2*I/a/d^2*f^2*c^2*x-I/a*f*e*x^2-2*I/a/d^2*e*f*c^2+4/a/d*f*e*ln(1-I*exp(I*(d*x+c)))*x+4/a/d^2*f*e*ln(1-I*exp(I*
(d*x+c)))*c+4/a/d^2*f*e*c*ln(exp(I*(d*x+c)))-4*I/a/d^2*f*e*polylog(2,I*exp(I*(d*x+c)))-4/a/d^2*f*e*c*ln(exp(I*
(d*x+c))+I)-1/3*I/a*f^2*x^3-4*I/a/d*e*f*c*x+4*f^2*polylog(3,I*exp(I*(d*x+c)))/a/d^3-2/a/d^3*f^2*c^2*ln(exp(I*(
d*x+c)))+2/a/d*f^2*ln(1-I*exp(I*(d*x+c)))*x^2-2/a/d^3*f^2*ln(1-I*exp(I*(d*x+c)))*c^2+2/a/d^3*f^2*c^2*ln(exp(I*
(d*x+c))+I)-4*I/a/d^2*f^2*polylog(2,I*exp(I*(d*x+c)))*x+4/3*I/a/d^3*f^2*c^3+I/a*e^2*x+2/a/d*ln(exp(I*(d*x+c))+
I)*e^2-2/a/d*ln(exp(I*(d*x+c)))*e^2

________________________________________________________________________________________

Maxima [B]  time = 1.67445, size = 396, normalized size = 3.47 \begin{align*} -\frac{\frac{6 \, c e f \log \left (a d \sin \left (d x + c\right ) + a d\right )}{a d} - \frac{3 \, e^{2} \log \left (a \sin \left (d x + c\right ) + a\right )}{a} - \frac{-i \,{\left (d x + c\right )}^{3} f^{2} - 3 i \,{\left (d x + c\right )} c^{2} f^{2} + 6 i \, c^{2} f^{2} \arctan \left (\sin \left (d x + c\right ) + 1, \cos \left (d x + c\right )\right ) +{\left (-3 i \, d e f + 3 i \, c f^{2}\right )}{\left (d x + c\right )}^{2} + 12 \, f^{2}{\rm Li}_{3}(i \, e^{\left (i \, d x + i \, c\right )}) +{\left (-6 i \,{\left (d x + c\right )}^{2} f^{2} +{\left (-12 i \, d e f + 12 i \, c f^{2}\right )}{\left (d x + c\right )}\right )} \arctan \left (\cos \left (d x + c\right ), \sin \left (d x + c\right ) + 1\right ) +{\left (-12 i \, d e f - 12 i \,{\left (d x + c\right )} f^{2} + 12 i \, c f^{2}\right )}{\rm Li}_2\left (i \, e^{\left (i \, d x + i \, c\right )}\right ) + 3 \,{\left ({\left (d x + c\right )}^{2} f^{2} + c^{2} f^{2} + 2 \,{\left (d e f - c f^{2}\right )}{\left (d x + c\right )}\right )} \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} + 2 \, \sin \left (d x + c\right ) + 1\right )}{a d^{2}}}{3 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)^2*cos(d*x+c)/(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

-1/3*(6*c*e*f*log(a*d*sin(d*x + c) + a*d)/(a*d) - 3*e^2*log(a*sin(d*x + c) + a)/a - (-I*(d*x + c)^3*f^2 - 3*I*
(d*x + c)*c^2*f^2 + 6*I*c^2*f^2*arctan2(sin(d*x + c) + 1, cos(d*x + c)) + (-3*I*d*e*f + 3*I*c*f^2)*(d*x + c)^2
 + 12*f^2*polylog(3, I*e^(I*d*x + I*c)) + (-6*I*(d*x + c)^2*f^2 + (-12*I*d*e*f + 12*I*c*f^2)*(d*x + c))*arctan
2(cos(d*x + c), sin(d*x + c) + 1) + (-12*I*d*e*f - 12*I*(d*x + c)*f^2 + 12*I*c*f^2)*dilog(I*e^(I*d*x + I*c)) +
 3*((d*x + c)^2*f^2 + c^2*f^2 + 2*(d*e*f - c*f^2)*(d*x + c))*log(cos(d*x + c)^2 + sin(d*x + c)^2 + 2*sin(d*x +
 c) + 1))/(a*d^2))/d

________________________________________________________________________________________

Fricas [C]  time = 1.79578, size = 772, normalized size = 6.77 \begin{align*} \frac{2 \, f^{2}{\rm polylog}\left (3, i \, \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right ) + 2 \, f^{2}{\rm polylog}\left (3, -i \, \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right ) +{\left (-2 i \, d f^{2} x - 2 i \, d e f\right )}{\rm Li}_2\left (i \, \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right ) +{\left (2 i \, d f^{2} x + 2 i \, d e f\right )}{\rm Li}_2\left (-i \, \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right ) +{\left (d^{2} e^{2} - 2 \, c d e f + c^{2} f^{2}\right )} \log \left (\cos \left (d x + c\right ) + i \, \sin \left (d x + c\right ) + i\right ) +{\left (d^{2} f^{2} x^{2} + 2 \, d^{2} e f x + 2 \, c d e f - c^{2} f^{2}\right )} \log \left (i \, \cos \left (d x + c\right ) + \sin \left (d x + c\right ) + 1\right ) +{\left (d^{2} f^{2} x^{2} + 2 \, d^{2} e f x + 2 \, c d e f - c^{2} f^{2}\right )} \log \left (-i \, \cos \left (d x + c\right ) + \sin \left (d x + c\right ) + 1\right ) +{\left (d^{2} e^{2} - 2 \, c d e f + c^{2} f^{2}\right )} \log \left (-\cos \left (d x + c\right ) + i \, \sin \left (d x + c\right ) + i\right )}{a d^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)^2*cos(d*x+c)/(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

(2*f^2*polylog(3, I*cos(d*x + c) - sin(d*x + c)) + 2*f^2*polylog(3, -I*cos(d*x + c) - sin(d*x + c)) + (-2*I*d*
f^2*x - 2*I*d*e*f)*dilog(I*cos(d*x + c) - sin(d*x + c)) + (2*I*d*f^2*x + 2*I*d*e*f)*dilog(-I*cos(d*x + c) - si
n(d*x + c)) + (d^2*e^2 - 2*c*d*e*f + c^2*f^2)*log(cos(d*x + c) + I*sin(d*x + c) + I) + (d^2*f^2*x^2 + 2*d^2*e*
f*x + 2*c*d*e*f - c^2*f^2)*log(I*cos(d*x + c) + sin(d*x + c) + 1) + (d^2*f^2*x^2 + 2*d^2*e*f*x + 2*c*d*e*f - c
^2*f^2)*log(-I*cos(d*x + c) + sin(d*x + c) + 1) + (d^2*e^2 - 2*c*d*e*f + c^2*f^2)*log(-cos(d*x + c) + I*sin(d*
x + c) + I))/(a*d^3)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \frac{\int \frac{e^{2} \cos{\left (c + d x \right )}}{\sin{\left (c + d x \right )} + 1}\, dx + \int \frac{f^{2} x^{2} \cos{\left (c + d x \right )}}{\sin{\left (c + d x \right )} + 1}\, dx + \int \frac{2 e f x \cos{\left (c + d x \right )}}{\sin{\left (c + d x \right )} + 1}\, dx}{a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)**2*cos(d*x+c)/(a+a*sin(d*x+c)),x)

[Out]

(Integral(e**2*cos(c + d*x)/(sin(c + d*x) + 1), x) + Integral(f**2*x**2*cos(c + d*x)/(sin(c + d*x) + 1), x) +
Integral(2*e*f*x*cos(c + d*x)/(sin(c + d*x) + 1), x))/a

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (f x + e\right )}^{2} \cos \left (d x + c\right )}{a \sin \left (d x + c\right ) + a}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)^2*cos(d*x+c)/(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

integrate((f*x + e)^2*cos(d*x + c)/(a*sin(d*x + c) + a), x)